//
// Created by hy on 2018/9/3.
//

#ifndef HISEMAPHORE_H
#define HISEMAPHORE_H

#include <pthread.h>

class HiMutex;

class HiSemaphore {

public:
    HiSemaphore();
    ~HiSemaphore();
    int singal();
    int broadcast();
    int wait(HiMutex &AMutex);
    int wait_timeout(HiMutex &AMutex, int ms);
private:
    pthread_cond_t m_semaphore;
};


#endif 
